
var authorization = myStorage.getItem('memberidToken');
console.log(authorization);

ltNetwork.tokenGet(configUrl.COUPONLIST_URL,'',authorization,function(res){
	console.log(res);
	var data = res.data;
	var coupon = data[0].coupon;
	if(!data){
		$('.noneaddrDiv').show();
	}else{
		$('.noneaddrDiv').hide();
		$('#couponTmpl').tmpl(coupon,{
			getAvailableTime:function(){
				var availableBeginTime = this.data.availableBeginTime;	//开始时间
				var availableEndTime = this.data.availableEndTime;		//结束时间
				var beginTime = new Date(availableBeginTime).toLocaleDateString();
				var endTime = new Date(availableEndTime).toLocaleDateString();
				return{
					beginTime:beginTime,
					endTime:endTime
				}
			}
			
		}).appendTo('#couponList');
	}
},function(msg){
	console.log(msg);
})
